app.controller('appCtrl',['$scope','$rootScope','$http',
	function($scope,$rootScope,$http){
	//当某个view 载入失败时：when a view failed to be loaded.
	$rootScope.$on('$routeChangeError',function(event,currRoute,prevRoute,rejection){
		console.log('failed to change view');
		//i shound show an alert box here;
		console.log(rejection,event);
	});

	$scope.testauth = function(){
		$http.get('/api/none').success(function(data){
			console.log(data);
		}).error(function(data,aa,bb){
			console.log('some error happend:');
			console.log(data,aa,bb);
		})
	}

}]);


